package com.meetingshow.meeting.service.util;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseQueryParasBuilder;
import com.meetingshow.meeting.service.model.UserFollowQueryParas;

public class UserFollowQueryParasBuilder extends BaseQueryParasBuilder {
    public static QueryStruct userFollowQueryBuilder(QueryStruct queryStruct,
            UserFollowQueryParas userFollowQueryParas) throws Exception {
        builderInit(userFollowQueryParas, queryStruct);

        Map<String, Object> exactMap = queryStruct.getExactMap();

        if (StringUtils.isNotBlank(userFollowQueryParas.getId_e())) {
            exactMap.put(UserFollowServiceParas.USER_FOLLOW_ID,
                    new Integer(userFollowQueryParas.getId_e()));
        }
        
        if (StringUtils.isNotBlank(userFollowQueryParas.getMeetingId_e())) {
            exactMap.put(UserFollowServiceParas.USER_FOLLOW_MEETING_ID,
                    new Integer(userFollowQueryParas.getMeetingId_e()));
        }
        
        if (StringUtils.isNotBlank(userFollowQueryParas.getUserId_e())) {
            exactMap.put(UserFollowServiceParas.USER_FOLLOW_USER_ID,
                    new Integer(userFollowQueryParas.getUserId_e()));
        }
        pageBuilder(queryStruct, userFollowQueryParas);
        
        return queryStruct;
    }
}
